#include<stdio.h>
void hanoi(int n, char src, char auxiliary, char dest);
int main()
{
	int n;
	scanf("%d", &n);
	char a = 'a', b = 'b', c = 'c';
	hanoi(n, a, b, c);
	
	return 0;
}

void hanoi(int n, char src, char auxiliary, char dest)
{
	if(n == 1)
	{
		printf("%d:%c->%c\n", n, src, dest);
	}
	else
	{
		hanoi(n-1, src, dest, auxiliary);
		
		printf("%d:%c->%c\n", n, src, dest);
		
		hanoi(n-1, auxiliary, src, dest);
	}
}
 
